import { create } from 'zustand';

interface InitializeState {
  isDebug: boolean;
  setIsDebug: (isDebug: boolean) => void;
  isRuiLogin: boolean;
  setIsRuiLogin: (isRuiLogin: boolean) => void;
  homePage: string;
  setHomePage: (homePage: string) => void;
  enable_knowledge_governance: boolean;
  setEnable_knowledge_governance: (enable_knowledge_governance: boolean) => void;
}

const useInitializeStore = create<InitializeState>((set) => ({
  isDebug: false,
  setIsDebug: (isDebug) => set({ isDebug }),
  isRuiLogin: true,
  setIsRuiLogin: (isRuiLogin) => set({ isRuiLogin }),
  homePage: '/',
  setHomePage: (homePage) => set({ homePage }),
  enable_knowledge_governance: true,
  setEnable_knowledge_governance: (enable_knowledge_governance) =>
    set({ enable_knowledge_governance }),
}));

const useInitialize = () => {
  const store = useInitializeStore();
  return store;
};

export default useInitialize;
